<?php

/**
 * @author honestphan
 * @copyright 2012
 */

defined('DSVH') or die('Restricted access');



$page = $_GET['act'];
 switch($page){
   
    case 'view':
    $id = $_REQUEST['id'];
    $quangcao = getQuangCao($id);
    if($quangcao['link']){
    $direct = $quangcao['link'];
    } else {
    $direct = 'http://chotaybac.com';
    }
    $viewed = $quangcao['view'];
    $newview = $viewed +1;
    update_view_quang_cao($newview,$id);
    
    header('LOCATION: '.$direct);    
    exit();
    break;
    
    
 }
 
   

?>